package cn.ecnu.paper.mapper;

import cn.ecnu.paper.pojo.Write;
import cn.ecnu.paper.vo.AuthorVoSort;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WriteMapper {

    int insertWrite(Write write);

    List<AuthorVoSort> getAuthorVo(@Param("paperId") Integer paperId);

    @Delete("DELETE FROM `write` WHERE paper_id = #{paperId}")
    int deleteWriteByPaperId(@Param("paperId") Integer paperId);
}
